﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Document_Management
{
     public class PublicClass
    {
        static public void setRowNumber(DataGridView dgv)
        {
            //int i = 1;
            foreach (DataGridViewRow row in dgv.Rows)
            {
                //if(row. == DataControlRowType.DataRow)
                if (row.Index == dgv.Rows.Count - 1) break;
                row.HeaderCell.Value = (row.Index + 1).ToString();
                row.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
                //i++;
            }
            //for (int i = 0; i < dgv.Rows.Count; i++) dgv.Rows[i][0] = (i + 1).ToString();
           
        }
    }
}
